home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-19 | 7.4 KB | 119 lines | [TEXT/MPS ] |
-
- ; Created: Friday, May 8, 1992 3:53 PM
- ;
- ; File: ServerEventIntf.a
- ;
- ; Assembler Interface to the Macintosh Libraries
- ; Copyright Apple Computer, Inc. 1990
- ; All Rights Reserved
- ;
- ;___________________________________________________________________________
- ; NOTE: use this interface file with new kind of AINCLUDES available on ETO
-
- IF (&TYPE('__ServerEventIntf__') = 'UNDEFINED') THEN
- __ServerEventIntf__ SET 1
-
- IF &TYPE('__AppleTalk__') = 'UNDEFINED' THEN
- INCLUDE 'AppleTalk.a'
- ENDIF
-
-
- ; Constants used in the tSEQEntry
-
- ; The SEeventFlag bits in tSEQEntry specify when the server event handler would like to be called
- ; SEeventFlag bits
- bCSEHAFPInDoRequest EQU 0 ; An AFP call is starting up (in DoRequest, about to be dispatched)
- bCSEHAFPInSendResponse EQU 1 ; An AFP call has completed (in SendResponse, about to send out the response)
- bCSEHServerBusy EQU 2 ; A new session is being denied because the server is busy (socket starvation event)
- bCSEHServerShutdown EQU 3 ; The server just shut down
- bCSEHServerControlCall EQU 4 ; A server control call has just completed
- ; NOTE: The following server control calls do not cause a bCSEHServerControlCall server event:
- ; SCStartServer, SCInstallServerEventProc, SCRemoveServerEventProc, SCGetServerEventProc, SCServerVersion, and SCWakeServer.
- ; You can use the bCSEHServerStartup server event to detect server starts and wakeups.
- bCSEHShare EQU 5 ; An HFS Share trap has just completed
- bCSEHUnShare EQU 6 ; An HFS UnShare trap has just completed
- bCSEHSetDirAccess EQU 7 ; An HFS SetDirAccess trap has just completed
- bCSEHServerNameChange EQU 8 ; An attempt was made to change the server name (the attempt may or may not have been successful)
- bCSEHVolumePrep EQU 9 ; A new volume was just prepared for use with AppleShare
- bCSEHVolumeUnmount EQU 10 ; A volume unmount was attempted on an AppleShare volume
- bCSEHServerStartup EQU 11 ; The server just successfully started up
- bCSEHSessionTornDown EQU 12 ; A user's session was torn down because any one of a number of reasons, including a
- ; disconnect, server shutdown, timeout, or workstation initiated close session
- bCSEHOutOfSequence EQU 13 ; A packet was received out of sequence; the session may be a zombie
- bCSEHWksClosedSession EQU 14 ; A workstation closed its ASP session (i.e., it logged out)
- bCSEHSessionTimedOut EQU 15 ; A workstation's session timed out
- bCSEHSrvrClosedSession EQU 16 ; The server has closed a workstation's session
-
-
- ; When SEeventFlag bits bCSEHAFPInDoRequest or bCSEHAFPInSendResponse are set, the bits in SEwhichAFPFlag
- ; determine which AFP calls will cause the server event handler to be called.
- ; SEwhichAFPFlag bits
- ; bit 0 of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 192 (afpAddIcon)
- ; bit 1 of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 1
- ; bit 2 of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 2
- ; ...
- ; bit 31 of SEwhichAFPFlag[1] - call SE handler when AFPCommand = 31
- ; bit 0 of SEwhichAFPFlag[0] - call SE handler when AFPCommand = 32
- ; ...
- ; bit 63 of SEwhichAFPFlag[0] - call SE handler when AFPCommand = 63
-
-
- ; When SEeventFlag bit bCSEHServerControlCall is set, the bits in SEwhichSCFlag determine
- ; which server control calls will cause the server event handler to be called.
- ; SEwhichSCFlag bits
- ; bit 0 of SEwhichSCFlag - call SE handler when scCode = 0 (SCStartServer)
- ; ...
- ; bit 31 of SEwhichSCFlag - call SE handler when scCode = 31
-
-
- BufferMax EQU 48 ; maximum size of the Buffer in the ServerEventRecord
-
- ServerEventRecord RECORD 0
- theEventNumber DS.L 1 ; long: the server event that's occuring; see the SEeventFlag definitions above
- theServerTime DS.L 1 ; long: the server time (in Macintosh DateTime form)
- theResult DS.W 1 ; OSErr: the result of the operation
- ; if theEventNumber = bCSEHAFPInSendResponse: the AFP Error code to be returned
- ; if theEventNumber = bCSEHServerControlCall: the result of the server control call
- ; if theEventNumber = bCSEHShare, bCSEHUnShare, or bCSEHSetDirAccess: the result of the HFS call
- ; if theEventNumber = bCSEHServerNameChange: the result of a PRegisterName call, SECantRegNameErr, or SEDupNameErr
- ; if theEventNumber = bCSEHVolumeUnmount: noErr or fBsyErr (if volume is being used by a remote user)
- ; all other values of theEventNumber return noErr
- theBufSize DS.W 1 ; the number of bytes used in theBuffer
- theBuffer DS.B BufferMax ; Array of Byte:
- ; if theEventNumber = bCSEHAFPInDoRequest or bCSEHAFPInSendResponse: the first BufferMax bytes of the AFP packet */
- ; if theEventNumber = bCSEHServerControlCall: the first BufferMax bytes of the SCParamBlockRec */
- ; if theEventNumber = bCSEHShare, bCSEHUnShare, bCSEHSetDirAccess, bCSEHVolumePrep, or bCSEHVolumeUnmount: */
- ; the first BufferMax bytes of the HParamBlockRec */
- ; if theEventNumber = bCSEHServerNameChange: the new server name (in a Pascal string) */
- ; all other values of theEventNumber return a zero length buffer */
- theNameStr DS.B 32 ; Str31: the name of the file, if any; not always defined
- theAFPCommand DS.W 1 ; short: if theEventNumber = bCSEHAFPInDoRequest or bCSEHAFPInSendResponse, the AFP call number
-
- ; Note: If theEventNumber is bCSEHAFPInDoRequest, bCSEHAFPInSendResponse, bCSEHSessionTornDown, bCSEHOutOfSequence,
- ; bCSEHWksClosedSession, bCSEHSessionTimedOut, or bCSEHSrvrClosedSession, then theUNRecID, theUNSUserID,
- ; theUserName, and theSocketAddress of the user that made the call are returned.
-
- theUNRecID DS.L 1 ; long: the UNRecID of the user that made the call
- theUNSUserID DS.L 1 ; long: the UserID of the user that made the call
- theUserName DS.B 32 ; Str31: the name of the user that made the call
-
- ; Note: If theEventNumber is bCSEHAFPInDoRequest or bCSEHAFPInSendResponse, then theVRefNum and theDirID will be
- ; returned if applicable to the AFP call
-
- theVRefNum DS.W 1 ; short: the VRefNum of the volume upon which this operation was performed (not always applicable)
- theDirID DS.L 1 ; long: the DirID of the directory upon/within which this operation was performed (not always applicable)
- theSocketAddress DS AddrBlockRec ; the network address of the user's workstation in AddrBlock format
- size EQU *
- ENDR
-
-
- tSEQEntry RECORD 0
- SEQentry DS ATQEntry ; a regular AppleTalk Transition Queue entry
- SEeventFlag DS.L 1 ; long: specifies when the Server Event Handler would like to be called
- SEwhichAFPFlag DS.L 2 ; Array of long: specifies which AFP calls will cause the Server Event Handler to be called
- SEwhichSCFlag DS.L 1 ; long: specifies which Server Control calls will cause the Server Event Handler to be called
- size EQU *
- ENDR
-
-
- ENDIF ; ...already included